﻿#region BarChartCylindarAxis UI Control
//
// All rights are reserved. Reproduction or transmission in whole or in part, in 
// any form or by any means, electronic, mechanical or otherwise, is prohibited 
// without the prior written consent of the copyright owner.
// 
// Filename: BarChartCylindarAxis.xaml.cs
//
#endregion 
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;


namespace DiscoveryLogic.DataServices.DataSources
{
    /// <summary>
    /// Mortgage Account entity class
    /// </summary>
    public class MortgageAccount:Account
    {
        /// <summary>
        /// holder for interest rate
        /// </summary>
        private double interestRate;

        /// <summary>
        /// holder for amount past due
        /// </summary>
        private double amountPastDue;

        /// <summary>
        /// holder for next payment principal amount
        /// </summary>
        private double nextPaymentPrincipal;

        /// <summary>
        /// holder for next payment interest amount
        /// </summary>
        private double nextPaymentInterest;

        /// <summary>
        /// holder for estimated payments complete date
        /// </summary>
        private DateTime projectedPaymentCompleteDate;

        /// <summary>
        /// holder for payment schedule
        /// </summary>
        private AmortizationSchedule paymentSchedule;

        /// <summary>
        /// holder for payment schedule
        /// </summary>
        private double taxValueHouse;

        /// <summary>
        /// getter/setter for interest rate
        /// </summary>
        public double InterestRate
        {
            get { return interestRate; }
            set
            {
                if (interestRate != value)
                {
                    interestRate = value;
                    Notify();
                    OnPropertyChanged(new PropertyChangedEventArgs("InterestRate"));
                }
            }

        }

        /// <summary>
        /// getter/setter for amount past due
        /// </summary>
        public double AmountPastDue
        {
            get { return amountPastDue; }
            set
            {
                if (amountPastDue != value)
                {
                    amountPastDue = value;
                    Notify();
                    OnPropertyChanged(new PropertyChangedEventArgs("AmountPastDue"));
                }
            }
        }

        /// <summary>
        /// getter/setter for next payment principal
        /// </summary>
        public double NextPaymentPrincipal
        {
            get { return nextPaymentPrincipal; }
            set
            {
                if (nextPaymentPrincipal != value)
                {
                    nextPaymentPrincipal = value;
                    Notify();
                    OnPropertyChanged(new PropertyChangedEventArgs("NextPaymentPrincipal"));
                }
            }
        }

        /// <summary>
        /// getter/setter for the next payment interest amount
        /// </summary>
        public double NextPaymentInterest
        {
            get { return nextPaymentInterest; }
            set
            {
                if (nextPaymentInterest != value)
                {
                    nextPaymentInterest = value;
                    Notify();
                    OnPropertyChanged(new PropertyChangedEventArgs("NextPaymentInterest"));
                }
            }
        }

        /// <summary>
        /// getter/setter for projected payment complete date
        /// </summary>
        public DateTime ProjectedPaymentCompleteDate
        {
            get { return projectedPaymentCompleteDate; }
            set
            {
                if (projectedPaymentCompleteDate != value)
                {
                    projectedPaymentCompleteDate = value;
                    Notify();
                    OnPropertyChanged(new PropertyChangedEventArgs("ProjectedPaymentCompleteDate"));
                }
            }
        }

        /// <summary>
        /// getter/setter for payment schedule
        /// </summary>
        public AmortizationSchedule PaymentSchedule
        {
            get { return paymentSchedule; }
            set
            {
                if (paymentSchedule != value)
                {
                    paymentSchedule = value; 
                    Notify();
                    OnPropertyChanged(new PropertyChangedEventArgs("PaymentSchedule"));
                }
            }
        }

        /// <summary>
        /// getter/setter for tax value of house
        /// </summary>
        public double TaxValueHouse
        {
            get { return taxValueHouse; }
            set
            {
                if (taxValueHouse != value)
                {
                    taxValueHouse = value;
                    Notify();
                    OnPropertyChanged(new PropertyChangedEventArgs("TaxValueHouse"));
                }
            }
        }

        /// <summary>
        /// Constructor
        /// </summary>
        public MortgageAccount():this(0,string.Empty,AccountType.Savings,0,0,DateTime.MaxValue,0)
        {

        }


        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="id">system account id</param>
        /// <param name="accountNumber">account number</param>
        /// <param name="type">account type</param>
        /// <param name="balance">outstanding balance</param>
        /// <param name="minimumPayment">minimum payment</param>
        /// <param name="nextPaymentDueDate">next payment date</param>
        /// <param name="nextPaymentAmount">next payment amount</param>
        public MortgageAccount(int id,
            string accountNumber,
            AccountType type,
            double balance,
            double minimumPayment,
            DateTime nextPaymentDueDate,
            double nextPaymentAmount
            ):this(id, accountNumber, type, balance,minimumPayment,nextPaymentDueDate,nextPaymentAmount,0,0,0,0,DateTime.MaxValue,null,0)
        {
            
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="id">system account id</param>
        /// <param name="accountNumber">account number</param>
        /// <param name="type">account type</param>
        /// <param name="balance">outstanding balance</param>
        /// <param name="minimumPayment">minimum payment</param>
        /// <param name="nextPaymentDueDate">next payment date</param>
        /// <param name="nextPaymentAmount">next payment amount</param>
        /// <param name="interestRate">current interest rate</param>
        /// <param name="amountPastDue">amount past due</param>
        /// <param name="nextPaymentPrincipal">next payment principal component</param>
        /// <param name="nextPaymentInterest">next payment interest component</param>
        /// <param name="projectedPaymentCompleteDate">estimated completion date</param>
        /// <param name="paymentSchedule">payment schedule</param>
        public MortgageAccount(int id,
            string accountNumber,
            AccountType type,
            double balance,
            double minimumPayment,
            DateTime nextPaymentDueDate,
            double nextPaymentAmount,
            double interestRate,
            double amountPastDue,
            double nextPaymentPrincipal,
            double nextPaymentInterest,
            DateTime projectedPaymentCompleteDate,
            AmortizationSchedule paymentSchedule,
            double taxValueOfHouse
            )
            : base(id, accountNumber, type, balance, minimumPayment, nextPaymentDueDate, nextPaymentAmount)
        {
            this.interestRate = interestRate;
            this.amountPastDue = amountPastDue;
            this.nextPaymentInterest = nextPaymentInterest;
            this.nextPaymentPrincipal = nextPaymentPrincipal;
            this.projectedPaymentCompleteDate = projectedPaymentCompleteDate;
            this.paymentSchedule = paymentSchedule;
            this.taxValueHouse = taxValueOfHouse;
        }


    }
}
